package com.citywithincity.utils.dataconvert;

import java.text.SimpleDateFormat;
import java.util.Date;

import com.citywithincity.api.ApiBuildConfig;
import com.citywithincity.db.interfaces.IValueConvert;

public class UnixTime2DateShort implements IValueConvert {
	@Override
	public Object convert(Object value) {
		Integer v = (Integer)value;
		if(v==null || v.equals(Integer.valueOf(0)))return null;
		return new SimpleDateFormat(ApiBuildConfig.SHORT_DATE_TIME_FORMAT)
				.format(new Date((long)v*1000));
	}
}
